libxl: handle POLLERR, POLLHUP, POLLNVAL properly
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 11 May 2012 17:58:55 +0000 (18:58 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Fri, 11 May 2012 17:58:55 +0000 (18:58 +0100)
commit9104f1857f6e732e5e90c296b1575bbe72923ff7
tree16c01178afd0027a4ce61d8ba18edc05f4ac1007
parent343d66a666478e06e98b54be9ec8e9abfdfcd696
libxl: handle POLLERR, POLLHUP, POLLNVAL properly

Pass POLLERR and POLLHUP to fd callbacks, as is necessary.
Crash on POLLNVAL since that means our fds are messed up.

Document the behaviour (including the fact that poll sometimes sets
POLLHUP or POLLERR even if only POLLIN was requested.

Fix the one current fd callback to do something with POLLERR|POLLHUP.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
tools/libxl/libxl_event.c
tools/libxl/libxl_internal.h